% test script 
% plot(cos(linspace(0, 7, 1000)), 'LineWidth', 2);
% hold on;
plot(cos(linspace(0, 7, 1000)), 'r--', 'LineWidth', 3);
hold on;
plot(sin(linspace(0, 10, 1000)), 'b:', 'LineWidth', 4);

title('test a plot');
xlabel('x');
ylabel('y');
set(gcf, 'Position', [100 100 800 600]);
saveas(gcf, 'test.png');

export_fig test2.png 


% set the export_fig background as white; the default color is gray
% the export_fig crops the figure; 
set(gcf, 'Color', 'w');
export_fig test3.png;

% -m2 produce an image double the size (in pixels) of the on screen one 
% This helps change the resolution and get a more clear plot in MATLAB
export_fig  test4.png -m2

% -painters to make the dash and dot line in the figure looks much better 
export_fig test5.png -painters 

% -transparent Transparancy 
set(gcf, 'Color', 'none');
export_fig test6.png -transparent